package com.time.sky.controller;


import com.time.sky.entity.Database;
import com.time.sky.mapper.DatabaseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
public class DatabaseController {
    @Autowired
    private DatabaseMapper databaseMapper;

    @CrossOrigin
    @RequestMapping("database/selectDatabaseList")
    public List<Database> selectDatabaseList(@RequestBody Database database){
        return databaseMapper.selectDatabase(database);
    }
    @CrossOrigin
    @RequestMapping("database/findAll")
    public List<Database> findAll(){
        return databaseMapper.findAll();
    }

}
